package com.loong.system.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.loong.framework.annotation.TransferFile;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.Date;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;

@Data
public class SelfInfoDTO {
  /** 主键：id */
  @TableId(value = "id")
  @Schema(description = "id")
  @Length(max = 64, message = "编码长度不能超过64")
  private String id;

  /** 昵称 */
  @Size(max = 255, message = "编码长度不能超过255")
  @TableField(value = "nickname")
  @Schema(description = "昵称")
  @Length(max = 255, message = "编码长度不能超过255")
  private String nickname;

  /** 手机号 */
  @Size(max = 255, message = "编码长度不能超过255")
  @TableField(value = "phone")
  @Schema(description = "手机号")
  @Length(max = 255, message = "编码长度不能超过255")
  private String phone;

  /** 电子邮件 */
  @Size(max = 255, message = "编码长度不能超过255")
  @TableField(value = "email")
  @Schema(description = "电子邮件")
  @Length(max = 255, message = "编码长度不能超过255")
  private String email;

  /** 真实姓名 */
  @Size(max = 255, message = "编码长度不能超过255")
  @TableField(value = "real_name")
  @Schema(description = "真实姓名")
  @Length(max = 255, message = "编码长度不能超过255")
  private String realName;

  /** 密码 */
  @Size(max = 255, message = "编码长度不能超过255")
  @TableField(value = "password")
  @Schema(description = "密码")
  @Length(max = 255, message = "编码长度不能超过255")
  private String password;

  /** 头像id */
  @Size(max = 64, message = "编码长度不能超过64")
  @TableField(value = "logo_id")
  @Schema(description = "头像id")
  @Length(max = 64, message = "编码长度不能超过64")
  private String logoId;

  @Schema(description = "头像地址")
  @TransferFile(field = "logoId")
  private String logoSrc;

  /** 微信头像 */
  @Schema(description = "微信头像")
  private String wxAvatar;

  /** 性别 */
  @Size(max = 64, message = "编码长度不能超过64")
  @TableField(value = "sex")
  @Schema(description = "性别")
  @Length(max = 64, message = "编码长度不能超过64")
  private String sex;

  /** 生日 */
  @TableField(value = "birthday")
  @Schema(description = "生日")
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private Date birthday;

  /** 签名 */
  @TableField(value = "sign")
  @Schema(description = "签名")
  private String sign;

  /** 角色标识 */
  @TableField(value = "role_signs")
  @Schema(description = "角色标识")
  private String[] roleSigns;

  /** 创建日期 */
  @TableField(value = "gmt_create")
  @Schema(description = "创建日期")
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private LocalDateTime gmtCreate;

  /** 修改日期 */
  @TableField(value = "gmt_modified")
  @Schema(description = "修改日期")
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private LocalDateTime gmtModified;
}
